package com.rex.saas.enums;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * DeviceTypeEnum
 *
 * @author zhusiyu
 **/
@Getter
@AllArgsConstructor(access = AccessLevel.PRIVATE)
public enum DeviceTypeEnum {

    /**
     *
     */
    GATEWAY(1, "gateway"),
    SUB_DEVICE(2, "subDevice"),
    DEVICE(3, "device"),
    ;
    /**
     *
     */
    private Integer code;
    /**
     * 信息
     */
    private String message;

    public static String getMessageByCode(Integer type) {
        for (DeviceTypeEnum value : values()) {
            if (value.code.equals(type)) {
                return value.message;
            }
        }
        return null;
    }
}
